package com.zeekr.orm.config;

import com.zeekr.orm.aop.LoInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author 吴文杰
 * @version 1.0
 * @since 2025/3/14 22:46
 */
@Slf4j
@Configuration
public class WebConfig implements WebMvcConfigurer {

  @Resource
  LoInterceptor loInterceptor;

  @Override
  public void addResourceHandlers(ResourceHandlerRegistry registry) {
    // registry.addResourceHandler("/img/**").addResourceLocations("file:D:\\img\\");
    registry.addResourceHandler("/api/img/**").addResourceLocations("classpath:/static/img/");
  }

  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    // registry.addInterceptor(loInterceptor).addPathPatterns("/api/**");
  }
}
